package com.xbongbong.saas.model;

import com.xbongbong.paas.domain.entity.PaasFormSubDataEntity;
import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.saas.domain.entity.PaymentSheetSubDataEntity;
import org.elasticsearch.action.support.WriteRequest;

import java.util.List;
import java.util.Map;

/**
 *
 * @author shian
 * @date 2020/9/18
 */
public interface PaymentSheetSubDataModel extends IModel<PaymentSheetSubDataEntity> {

    @Override
    Integer insert(PaymentSheetSubDataEntity entity) throws XbbException;

    @Override
    Integer update(PaymentSheetSubDataEntity entity) throws XbbException;

    @Override
    List<PaymentSheetSubDataEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    Integer insertBatch(List<PaymentSheetSubDataEntity> paymentSheetSubDataEntities) throws XbbException;

    List<PaymentSheetSubDataEntity> getByDataId(Long dataId, String corpid);

    List<PaymentSheetSubDataEntity> getByDataIds(List<Long> dataIds, String corpid, DelEnum delEnum);

    Integer updateBatch(List<UpdateDataEntity> updateDataList, String corpid) throws XbbException;

    Integer deleteBatch(String corpid, List<PaymentSheetSubDataEntity> entities, WriteRequest.RefreshPolicy refreshPolicy) throws XbbException;

    Integer deleteByDataId(Long dataId, String corpid) throws XbbException;

    Integer deleteBatchByDataId(List<Long> dataIds, String corpid, DelEnum delEnum) throws XbbException;

    void restoreBatch(List<Long> dataIds, String corpid) throws XbbException;
    /**
     * 根据id删除子表单数据
     * @param payPlanSheetSubDataIdMap
     * @param corpid
     * @return java.lang.Integer
     * @author 吴峰
     * @date 2020/10/15 15:11
     * @throws XbbException
     */
    Integer deleteBatchByIdIn(Map<Long, Long> payPlanSheetSubDataIdMap, String corpid) throws XbbException;
    /**
     * @param updateList
     * @param corpid
     * @return java.lang.Integer
     * @author 吴峰
     * @date 2020/10/15 15:28
     * @throws XbbException
     */
    Integer updateBatchByEntity(List<? extends PaasFormSubDataEntity> updateList, String corpid) throws XbbException;

    /**
     * 更新del
     * @param updateDelList
     * @param corpid
     * @param refreshPolicy
     * @param delEnum
     * @return
     * @throws XbbException
     */
    Integer updateDel(List<PaymentSheetSubDataEntity> updateDelList, String corpid, WriteRequest.RefreshPolicy refreshPolicy, DelEnum delEnum) throws XbbException;
}
